var gamejs = require('gamejs');

/**
 * Creates a map, which holds a matrix of the navigable terrain and the obstacles
 *@param {Match} match the current match
 *@param {number} width the map width
 *@param {number} height the map height
 */
var Map = exports.Map = function(match, width , height) {
	this.matrix = [];
	this.obstacles = new gamejs.sprite.Group();
	this.enemies = new gamejs.sprite.Group();
	this.turrets = new gamejs.sprite.Group();
	this.radars = new gamejs.sprite.Group();
	this.SIZE= [width,height];
 	  this.currentMatch = match;
};


/**
 * Return the match where this map work.
 *
 * @return {Match} The match where this map work.
 */
Map.prototype.getMatch= function() {
    return this.currentMatch;
};

/**
 * Return the enemies group.
 *
 * @return {Group} The enemies group.
 */
Map.prototype.getEnemies=function() {
	return this.enemies ;
};

/**
 * Return the obstaclesgroup.
 *
 * @return {Group} The obstacles group.
 */
Map.prototype.getObstacles=function() {
	return this.obstacles;
};

/**
 * Return the turrets group.
 *
 * @return {Group} The turrets group.
 */
Map.prototype.getTurrets= function() {
	return this.turrets;
};

/**
 * Return the radars group.
 *
 * @return {Group} The radars group.
 */
Map.prototype.getRadars= function() {
	return this.radars;
};

/**
 * Update function
 */
Map.prototype.update = function(){
	//update stuff here
};

/**
 * Draw on surface
 
 * @param {gamejs.surface} where to draw
 */
Map.prototype.draw = function(surface){};

/**
 * Get the current map size
 *
 * @returns {Number[]}  The width and height of the Surface
 */
Map.prototype.getSize = function(){};

/** 
 * Fill a pixel
 *
 * @param {array} coordinates The coordinates as vector [x, y]
 */
Map.prototype.fill = function(coordinates) { }

/**
 * Clear a pixel
 *
 * @param {array} coordinates The coordinates as vector [x, y]
 */
Map.prototype.clear = function(coordinates) { }

/**
 * Tells if the pixel is filled
 *
 * @param {array} coordinates The coordinates as vector [x, y]
 *
 * @returns {boolean} True if the pixel is filled, false otherwise
 */
Map.prototype.isFilled = function(coordinates) { }

/**
 * Adds an obstacle to the map and fills the sprite area
 *
 * @param {Obstacle} obstacle The obstacle to add
 */
Map.prototype.addObstacle = function(obstacle) { }

/**
 * Removes an obstacle to the map and clears the sprite area
 *
 * @param {Obstacle} obstacle The obstacle to remove
 */
Map.prototype.removeObstacle = function(obstacle) { }

/**
 * Adds an enemy to the map and fills the sprite area
 *
 * @param {Enemy} enemy The enemy to add
 */
Map.prototype.addEnemy = function(enemy) { }

/**
 * Removes enemy to the map and clears the sprite area
 *
 * @param {Enemy} enemy  They enemy to remove
 */
Map.prototype.removeEnemy = function(enemy) { }

/**
 * Adds turrett the map and fills the sprite area
 *
 * @param {Turret} turret The turret to add
 */
Map.prototype.addTurret = function(turret) { }

/**
 * Removes an turret from the map and clears the sprite area
 *
 * @param {Turret} turret The turret to remove
 */
Map.prototype.removeTurret = function(turret){ }

/**
 * Adds a radar to the map and fills the sprite area
 *
 * @param {Radar} radar The radar to add
 */
Map.prototype.addRadar = function(radar) { }

/**
 * Removes a radar to the map and clears the sprite area
 *
 * @param {Radar} radar The radar to remove
 */
Map.prototype.removeRadar = function(radar) { }